#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/11/26 20:15
# @Author  : 新猿异码
# @Site    : https://gitee.com/chshao/autotest
# @CSDN    : https://blog.csdn.net/m0_37576542?type=blog
# @File    : BaseTest.py
# @Software: PyCharm


class BaseTestCase(object):
    ModelType = 'TestCase'

    # 重写__new__使得BaseTestCase的子类变成单例类
    def __new__(cls, *args, **kwargs):
        if not hasattr(cls, '_instance'):
            orig = super(BaseTestCase, cls)
            cls._instance = orig.__new__(cls, *args, **kwargs)
        return cls._instance

    def setup_start(self):
        pass

    def setup(self):
        pass

    def setup_end(self):
        pass

    def teardown_start(self):
        pass

    def teardown(self):
        pass

    def teardown_end(self):
        pass


class BaseTestSuit(object):
    ModelType = 'TestSuite'


class BaseTestProject(object):
    ModelType = 'Project'

    def setup(self):
        pass

    def run(self):
        pass

    def teardown(self):
        pass
